<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "customer".
 *
 * @property int $id id编号
 * @property int $userid 用户id
 * @property string $username 用户别名
 * @property string $password 密码
 * @property string $pwd_pass 加密字段
 * @property int $type 0 未激活 1激活
 * @property int $code 七天内到期标识 0否 1是
 * @property string $time 时间戳
 * @property string $due_time 到期时间
 */
class Customer extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'customer';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['userid', 'username', 'password', 'pwd_pass', 'time', 'due_time'], 'required'],
            [['userid', 'type', 'code'], 'integer'],
            [['username', 'pwd_pass', 'time', 'due_time'], 'string', 'max' => 16],
            [['password'], 'string', 'max' => 32],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'userid' => 'Userid',
            'username' => 'Username',
            'password' => 'Password',
            'pwd_pass' => 'Pwd Pass',
            'type' => 'Type',
            'code' => 'Code',
            'time' => 'Time',
            'due_time' => 'Due Time',
        ];
    }
}
